/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Santiago.Escobar.M
 */
@Embeddable
public class CiudadPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "isopais")
    private String isopais;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "isociudad")
    private String isociudad;

    public CiudadPK() {
    }

    public CiudadPK(String isopais, String isociudad) {
        this.isopais = isopais;
        this.isociudad = isociudad;
    }

    public String getIsopais() {
        return isopais;
    }

    public void setIsopais(String isopais) {
        this.isopais = isopais;
    }

    public String getIsociudad() {
        return isociudad;
    }

    public void setIsociudad(String isociudad) {
        this.isociudad = isociudad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (isopais != null ? isopais.hashCode() : 0);
        hash += (isociudad != null ? isociudad.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CiudadPK)) {
            return false;
        }
        CiudadPK other = (CiudadPK) object;
        if ((this.isopais == null && other.isopais != null) || (this.isopais != null && !this.isopais.equals(other.isopais))) {
            return false;
        }
        if ((this.isociudad == null && other.isociudad != null) || (this.isociudad != null && !this.isociudad.equals(other.isociudad))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.CiudadPK[ isopais=" + isopais + ", isociudad=" + isociudad + " ]";
    }
    
}
